package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.service.MemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.MemberMapper;
import com.itheima.pojo.Member;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {

    @Override
    public Member findMemberByTelephone(String telephone) {
        QueryWrapper<Member> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("telephone",telephone);
        return baseMapper.selectOne(queryWrapper);
    }

    @Override
    public long saveMember(Member member) {
          save(member);
        return member.getId();
    }
}
